package week07.personcmp;

import java.util.Random;

public class TestPersonCmp {
    public static void main(String[] args) {
        Person[] personArray = new Person[10];
        Random rdn = new Random();
        for(int i =0;i<personArray.length;i++){
            personArray[i] = new Person("Person<"+i+">",rdn.nextInt(200),rdn.nextInt(100));
        }
        for(int i =0;i<personArray.length;i++){
            System.out.println(personArray[i].getName()+" - "+personArray[i].getHeight()+" - "+personArray[i].getWeight());
        }

        AbstractPersonCmp abstractPersonCmp = new PersomCmpByHeight();
        abstractPersonCmp.sort(personArray);

        System.out.println("----------------------------");

        for(int i =0;i<personArray.length;i++){
            System.out.println(personArray[i].getName()+" - "+personArray[i].getHeight()+" - "+personArray[i].getWeight());
        }
    }
}
